package com.example.gulimallproduct.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;

import com.example.common.valid.ListValue;
import com.example.common.valid.addGroup;
import com.example.common.valid.updateGroup;
import lombok.Data;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.*;

/**
 * 
 * 
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2024-01-09 20:33:34
 */
@Data
@TableName("pms_brand")
public class BrandEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * id
	 */
	@NotNull(message = "更新时不能为空",groups = {updateGroup.class})
	@Null(message = "新增时必须为空",groups = {addGroup.class})
	@TableId
	private Long brandId;
	/**
	 * 
	 */
	@NotBlank(message = "品牌名不能为空",groups = {addGroup.class})
	private String name;
	/**
	 * logo
	 */
	@NotEmpty(message = "logo不能为空",groups = {addGroup.class})
	@URL(message = "logo必须是一个合法的url",groups = {addGroup.class, updateGroup.class})
	private String logo;
	/**
	 * 
	 */
	private String descript;
	/**
	 * [0-1-]
	 */
	@ListValue(vals = {0,1},groups = {addGroup.class, updateGroup.class})
	private Integer showStatus;
	/**
	 * 
	 */
	@NotEmpty(message = "检索首字母不能为空",groups = {addGroup.class})
	@Pattern(regexp = "^[a-zA-Z]$",message = "检索首字母必须是a-z或A-Z的字母",groups = {addGroup.class, updateGroup.class})
	private String firstLetter;
	/**
	 * 
	 */
	@NotNull(message = "排序字段不能为空",groups = {addGroup.class})
	@Min(value = 0,message = "排序值必须大于或等于0",groups = {addGroup.class, updateGroup.class})
	private Integer sort;

}
